
;;******************************************
;;****TKS GLOBE VARIES DEFINE FOR ASM CODE *
;;******************************************
;-SELECT IC BODY & INCLUDE REFERENCE FILE


;*******************************
;********   IC SELECT  *********
;*******************************
#DEFINE _BS84B08A_ ;_BS83B04C_
;*******************************

;------------------------
;-DEFINE SYSTEM CLOCK   -
;------------------------
ifdef _BS83A02A_
#define SystemClock             2       ;0=2MHZ
                                        ;1=4MHZ
                                        ;2=8MHZ
else
#define SystemClock             0       ;0=8MHZ
                                        ;1=12MHZ
                                        ;2=16MHZ
endif



ifdef _BS83A02A_                  
#include BS83A02A-4.INC
#define KeyAmount               2
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83A02C_                  
#include BS83A02C.INC
#define KeyAmount               2
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83A04A_         
#include BS83A04A-4.INC
#define KeyAmount               4
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83B04A_         
#include BS83B02A-4.INC
#define KeyAmount               4
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83B04C_
#include BS83B04C.INC
#define KeyAmount               4 
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         080H
endif

ifdef _BS83B08A_
#include BS83B08A-3.INC
#define KeyAmount               8
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83B08C_
#include BS83B08C.INC
#define KeyAmount               8
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         080H
endif

ifdef _BS83B12A_
#include BS83B12A-4.INC
#define KeyAmount               12
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif


ifdef _BS84B08A_
#include BS84B08A-3.INC
#define KeyAmount               12
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS84C12A_
#include BS84C12A-3.INC
#define KeyAmount               12
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif


ifdef _BS83B12C_
#include BS83B12C.INC
#define KeyAmount               12
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         080H
endif

ifdef _BS83B16A_
#include BS83B16A-4.INC
#define KeyAmount               16
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         060H
endif

ifdef _BS83B16C_
#include BS83B16C.INC
#define KeyAmount               16
#define TouchTimeBaseINTaddress 014H
#define TouchINTaddress         008H
#define RAMbank0Address         080H
#define RAMbank1Address         080H
endif

#define TouchKeyAmount  KeyAmount

;--------------------------------
;-TOUCH KEY LIBRARY VARIES DEFINE
;--------------------------------
;-numeric operate ; range 0 ~ 15;                                             
;#define DebounceTimes           0         

;-numeric operate ; range 0 ~ 15; function: Time period to calibrate                   
;#define AutoCalibrationPeriod   4    ;Sensitive Adjust

;-bit operate                   ; function: Sensitive double up
;#define HighSensitive           1       ;0=Normal ; 1=High Sensitive

;-numeric operate ; range 0 ~ 15; function: key holding time ,if time out will reset key status to non-press
;#define MaximumKeyHoldTime      15      ;0=disable ; 1=4 secend ...... 15=60secend
 
;-bit operate ; range 0/1       ; function: Fasting internal singal filter speed led key response faster
;#define FastResponse            0       ;0=Normal ; 1=Fast Response       

;-bit operate ; range 0/1       ; function: enalbe hardware hopping function                           
;#define AutoFrequencyHopping    1       ;0=disable ; 1=enable

;-bit operate ; range 0/1       ; function: only one or all key active at the same time
;#define OneKeyActive            0       ;0=all key active ; 1=one key active

;-bit operate ; range 0/1       ; function: Low power consumption 
#define PowerSave               0     ;0=disable ; 1=power save mode
 
;-bit operate ; range 0/1       ; function: Noise interfere protect to prevent false trigger                                
;#define NoiseProtect            0       ;0=disable ; 1=enable

;-bit operate ; range 0/1       ; function: moving calibration signal whatever key press or not
;#define MovingCalibration       1       ;0=calibrate when key non press  ; 1=enable calibration whatever key press or not

;//-numeric operate ; range 0 ~ 3 ; function: Settin RC2F Main frequency                                              
#define MainFrequency           0       ;C version IC//0=11M; 1=7M ;   2=3M ; 3=1M
                                        ;A version IC//0=2M ; 1=1.5M ; 2=1M ; 3=0.5M
;-Key threshold define 
;#define Key1Threshold           12
;#define Key2Threshold           12
;#define Key3Threshold           12
;#define Key4Threshold           12

;---------------------------------
;-DEFINE PIN AS I/O OR TOUCH INPUT
;--------------------------------- 
#define IO_TOUCH_ATTR           00000000000000000000000000000001B;0=IO ; 1=TOUCH INPUT
                           ;KEY 3   ~   2 ~ 2 ~ 1 ~ 1 ~ 0 ~ 0 ~0 ;KEY32~KEY1
                           ;    2       4   0   6   2   8   4  1


;-----------------------------------------
;-conbine above varies in GlobeOptionA/B/C
;-----------------------------------------
;#define GlobeOptionA            (AutoCalibrationPeriod<<4)|DebounceTimes                                           
;#define GlobeOptionB            (MaximumKeyHoldTime<<4)|HighSensitive                                                 
;#define GlobeOptionC            (MovingCalibration<<7)|(PowerSave<<6)|(OneKeyActive<<5)|(NoiseProtect<<4)|(AutoFrequencyHopping<<3)|(FastResponse<<2)|MainFrequency

#define GlobeOptionA            0                                          
#define GlobeOptionB            0                                                 
#define GlobeOptionC            MainFrequency




